angular.module('myApp')
.controller('myCtrl', function($scope,Dialog,$http){
	$scope.showDialog = function(){
		Dialog.show().then(function(){
			console.log('确定')
		},function(){
			console.log('取消')
		});
	}

	$scope.deleteItem = function (index){
		Dialog.show({
			title: '提示信息',
			content: '确认删除'+$scope.dataList[index].goodsName+'吗',
			confirmBtnText: 'ok',
			cancelBtnText: 'cancel'
		}).then(function(){
			$scope.dataList.splice(index,1);
		},function(){
			console.log('取消')
		});
	}

	$http.get('http://127.0.0.1:8001/v3.3/goods/goodsList',{
		params: {

		}
	}).then(function(rep){
		console.log(rep.data);
		$scope.dataList = rep.data.data.goodsList;
	},
	function(err){
		console.log(arguments);
	})
});
